package cn.iocoder.yudao.module.system.dal.mysql.zkdatanew;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.zkdatanew.ZkdataNewDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.zkdatanew.vo.*;

/**
 * 新数据纪录 Mapper
 *
 * @author hzx
 */
@Mapper
public interface ZkdataNewMapper extends BaseMapperX<ZkdataNewDO> {

    default PageResult<ZkdataNewDO> selectPage(ZkdataNewPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ZkdataNewDO>()
                .eqIfPresent(ZkdataNewDO::getDataUniq, reqVO.getDataUniq())
                .eqIfPresent(ZkdataNewDO::getDataTotal, reqVO.getDataTotal())
                .betweenIfPresent(ZkdataNewDO::getSendTime, reqVO.getSendTime())
                .eqIfPresent(ZkdataNewDO::getPacketLength, reqVO.getPacketLength())
                .eqIfPresent(ZkdataNewDO::getDataReceiver, reqVO.getDataReceiver())
                .eqIfPresent(ZkdataNewDO::getDataSender, reqVO.getDataSender())
                .eqIfPresent(ZkdataNewDO::getDataType, reqVO.getDataType())
                .eqIfPresent(ZkdataNewDO::getDataSeq, reqVO.getDataSeq())
                .eqIfPresent(ZkdataNewDO::getDataLength, reqVO.getDataLength())
                .eqIfPresent(ZkdataNewDO::getDataPayload, reqVO.getDataPayload())
                .eqIfPresent(ZkdataNewDO::getOriData, reqVO.getOriData())
                .eqIfPresent(ZkdataNewDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(ZkdataNewDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ZkdataNewDO::getId));
    }

}